import service from '@/utils/crmRequest'

export default () => ({
  GET_JSON_DATA: () => {
    return service({
      url: '/api/common/config-json',
      method: 'get'
    })
  },

  // 字典数据创建---下拉选择（可创建）
  DICTIONARY_CREATE: (data) => {
    return service({
      url: '/api/sysDictionaryDetail/sysDictionaryDetailByType',
      method: 'post',
      donNotShowLoading: true,
      data
    })
  },

  // 模糊搜索获取产品
  GET_PRODUCT_LIST: (params) => {
    return service({
      url: '/api/product/getList',
      method: 'get',
      donNotShowLoading: true,
      params
    })
  },

  // 模糊搜索获取产品
  GET_PRODUCT_PRICE_LIST: (params) => {
    return service({
      url: '/api/productPriceStrategy/list',
      method: 'get',
      params
    })
  },

  // 检测字段是否重复
  COMMON_CHECK_UNIQUE: (params) => {
    return service({
      url: '/api/common/check-unique',
      method: 'get',
      donNotShowLoading: true,
      params
    })
  },
  // 有效合同列表
  VALID_CONTRACT_LIST: (data) => {
    return service({
      url: `/api/contract/list-in-use`,
      method: 'post',
      data
    })
  },

  // 获取终端
  TERMINAL_CHECK_TERMINAL: (data) => {
    return service({
      url: `/api/terminal/checkTerminal`,
      method: 'post',
      donNotShowLoading: true,
      data
    })
  },

  // 获取终端
  GET_QINIU_TOKEN: () => {
    return service({
      url: `/api/common/token`,
      method: 'get',
    })
  },
  // 信用详情
  CREDIT_DETAIL: (data) => {
    return service({
      url: `/api/credit/detail`,
      method: 'post',
      data
    })
  },
  // 信用产品列表
  CREDIT_PRODUCT_LIST: (data) => {
    return service({
      url: `/api/credit/list`,
      method: 'post',
      data
    })
  },
  // 信用产品列表 订单
  CREDIT_PRODUCT_LIST_FOR_ORDER: (data) => {
    return service({
      url: `/api/credit/list-for-order`,
      method: 'post',
      data
    })
  },
  // 设置信用
  CREDIT_CREATE: (data) => {
    return service({
      url: `/api/credit/create`,
      method: 'post',
      data
    })
  },
  // 编辑信用--审批不通过
  CREDIT_EDIT: (data) => {
    return service({
      url: `/api/credit/update`,
      method: 'post',
      data
    })
  },
  // 调整信用
  CREDIT_CHANGE: (data) => {
    return service({
      url: `/api/credit/change`,
      method: 'post',
      data
    })
  },
  // 获取配送费下拉列表---配送服务列表
  DISTRIBUTE_PRICE_LIST: (data) => {
    return service({
      url: `/api/distributeContractDetail/getPullList`,
      method: 'post',
      data
    })
  },
  // 获取配送费下拉列表---配送服务列表
  DISTRIBUTE_PRICE_LIST2: (data) => {
    return service({
      url: `/api/distributeContractDetail/agentProductDisDetailPull`,
      method: 'post',
      data
    })
  },

  GET_COMMON_HISTORY: (params) => {
    return service({
      url: `/api/common/history`,
      method: 'get',
      params
    })
  },

  GET_CURRENT_TASK: (id) => {
    return service({
      url: `/api/workFlow/currentTask?processInstanceId=` + id,
      method: 'get',
    })
  },
  // 职员列表--1、有效，2、无效
  STAFF_PEOPLE_LIST: (params) => {
    return service({
      url: `/api/sysUser/downList`,
      method: 'get',
      params
    })
  },
  // 开发表--终端关系详情
  DEV_TERMINAL_DETAIL: (id) => {
    return service({
      url: `/api/distributeContractDetail/getRelationDevDisDetail?id=${id}`,
      method: 'get',
    })
  },
  // --------------------------获取省市区数据---包含是否可选字段----------------------------------
  GET_AREA_LIST: (params) => {
    return service({
      url: `/api/market-rules/region`,
      method: 'get',
      params
    })
  },

  // ------------------------财务分账 终端、代理搜索-------------------------------------------
  DEV_AGENT_TERMINAL_SEARCH: (data) => {
    return service({
      url: `/api/dev/distinct-agent-terminal`,
      method: 'post',
      data
    })
  },
  // -----------------------获取职员列表（自己及下级）----------------------
  USER_LIST: (data) => {
    return service({
      url: `api/sysUser/superOrLowerUsers`,
      method: 'post',
      data
    })
  },

  // 获取街道
  GET_SYS_REGION_STREET: (code) => {
    return service({
      url: `/api/sysRegion/children?code=${code}`,
      method: 'get',
    })
  },

  MENU_PERMISSION: () => {
    return service({
      url: `/api/common/permission`,
      method: 'get',
    })
  },

})
